package com.mdd.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mdd.usercenter.model.domain.Team;
import com.mdd.usercenter.model.domain.User;
import com.mdd.usercenter.model.request.TeamJoinRequest;
import com.mdd.usercenter.model.request.TeamQueryRequest;
import com.mdd.usercenter.model.request.TeamQuitRequest;
import com.mdd.usercenter.model.request.TeamUpdateRequest;
import com.mdd.usercenter.model.vo.TeamUserVo;

import java.util.List;

/**
* @author mdd
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2023-04-19 15:46:49
*/
public interface TeamService extends IService<Team> {

    /**
     * 添加队伍
     * @param team
     * @return
     */
    Long addTeam(Team team, User loginUser);

    /**
     * 得到队伍列表
     * @param teamQueryRequest
     * @param isAdmin
     * @param loginUser
     * @return
     */
    List<TeamUserVo> getTeamList(TeamQueryRequest teamQueryRequest, boolean isAdmin, User loginUser);

    /**
     * 更新队伍
     * @param teamUpdateRequest
     * @param loginUser
     * @return
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest, User loginUser);

    /**
     * 用户加入队伍
     * @param teamJoinRequest
     * @param loginUser
     * @return
     */
    Boolean joinTeam(TeamJoinRequest teamJoinRequest, User loginUser);

    /**
     * 退出队伍
     * @param teamQuitRequest
     * @param loginUser
     * @return
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 解散队伍
     * @param teamId
     * @param loginUser
     * @return
     */
    boolean disbandTeam(Long teamId, User loginUser);
}
